package com.jboost.modules.file.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class FileProperties implements InitializingBean {

    @Value(value = "${server.host}")
    private String webHost;
    /**
     * 本地保存，访问的 port
     */
    @Value(value = "${server.visit-port}")
    private String port;
    /**
     * 本地保存，访问的 context
     */
    @Value(value = "${server.servlet.context-path}")
    private String context;

    public static String WEB_HOST;
    public static String PORT;
    public static String CONTEXT;


    @Override
    public void afterPropertiesSet() throws Exception {
        WEB_HOST = webHost;
        PORT = port;
        CONTEXT = context;
    }
}
